local skel = fk.CreateSkill {
  name = "rmt__guowen",
}

skel:addEffect("active", {
  anim_type = "drawcard",
  card_num = 0,
  target_num = 0,
  prompt = "#rmt__guowen",
  can_use = function(self, player)
    return player:usedSkillTimes(skel.name, Player.HistoryPhase) == 0 and not player:isKongcheng()
  end,
  times = function (self, player)
    return 1 - player:usedSkillTimes(skel.name, Player.HistoryPhase)
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local cards = player:getCardIds("h")
    player:showCards(cards)
    cards = table.filter(cards, function(id) return not Fk:getCardById(id).is_damage_card end)
    if #cards > 0 then
      room:recastCard(cards, player, skel.name)
    end
  end,
})

skel:addEffect(fk.Damage, {
  can_refresh = function(self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and player:usedSkillTimes(skel.name, Player.HistoryPhase) > 0
  end,
  on_refresh = function(self, event, target, player, data)
    player:setSkillUseHistory(skel.name, 0, Player.HistoryPhase)
  end,
})

Fk:loadTranslationTable{
  ["rmt__guowen"] = "国问",
  [":rmt__guowen"] = "出牌阶段限一次，你可以展示所有手牌并重铸其中的非伤害类牌。你造成伤害后，重置此技能。",
  ["#rmt__guowen"] = "国问：你可展示所有手牌并重铸其中的非伤害类牌",

  ["$rmt__guowen"] = "We choose to go to then moon, we choose to go to then moon!",
}

return skel
